const { querySql , updateSql, insertSql , deleteSql } = require('../db')


function getFacilityList(query) {
  const { facilityName , facilityStatus } = query
  return querySql(`select * from facility_list where facilityName like '%${facilityName || ''}%'`)
}

function editFacility(query){
  return updateSql( query , 'facility_list' , `where id = ${query.id}` )
}

function createFacility(query){
  return insertSql( query , 'facility_list' )
}

function deleteFacility(query){
  return deleteSql('id',query.id,'facility_list')
}

module.exports = {
  getFacilityList,
  editFacility,
  createFacility,
  deleteFacility
} 